package com.bbva.gptf.back.servicio.carga;

import com.bbva.gptf.back.dominio.Tgpt036VarGlobal;
import com.bbva.gptf.dto.bean.VarGlobal;
import com.bbva.gptf.dto.servicio.carga.ServicioVarGlobal;
import com.bbva.jee.arq.spring.core.httpService.HttpService;

/**
 * @author Javier Estrella Rodriguez
 * @version 1.0
 * @created 19-dic-2012 11:14:25
 */
@HttpService(serviceName = "servicioVarGlobalHttp")
public class ServicioVarGlobalImpl implements ServicioVarGlobal {
	/**
	 * Metodo para obtener el valor de una variable global.
	 * 
	 * @param nbVariable
	 *            Nombre de la variable, debe ser unico
	 */
	@Override
	public VarGlobal obtenerVarGlobal(final String nbVariable) {
		final VarGlobal varGlobalBean = new VarGlobal();
		final Tgpt036VarGlobal varGlobal = Tgpt036VarGlobal
				.findTgpt036VarGlobalByNbVariable(nbVariable);
		varGlobalBean.setCdVariable(varGlobal.getCdVariable());
		varGlobalBean.setNbVariable(varGlobal.getNbVariable());
		varGlobalBean.setStVariable(varGlobal.getStVariable());
		varGlobalBean.setTmUmo(varGlobal.getTmUmo());
		return varGlobalBean;
	}

}